﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ObracunKamataProknjizen typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ObracunKamataProknjizenDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ObracunKamataProknjizenDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ObracunKamataProknjizen _currentObracunKamataProknjizen = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxObracunKamataProknjizenDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxObracunKamataProknjizenErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxObracunKamataProknjizenBindingSource;
		
		/// <summary> 
		/// the DGV column associated with the IDKnjizenjeStavka property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDKnjizenjeStavkaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOrganizacija property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOrganizacijaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObracunKamata property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObracunKamataDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the KontoSifraPrijenos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKontoSifraPrijenosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DugIliPot property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxDugIliPotDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Kontrola property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKontrolaDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.KnjizenjeStavka> _IDKnjizenjeStavkaList;
		
		/// <summary> 
		/// The list of selectable KnjizenjeStavka
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.KnjizenjeStavka> IDKnjizenjeStavkaList
		{
			get {return this._IDKnjizenjeStavkaList;}
			set 
			{
				this._IDKnjizenjeStavkaList = value;
				this.uxIDKnjizenjeStavkaDataGridViewColumn.DataSource = null;
				this.uxIDKnjizenjeStavkaDataGridViewColumn.DataSource = this._IDKnjizenjeStavkaList;
			}
		}
		
		private bool _allowNewItemInIDKnjizenjeStavkaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of KnjizenjeStavka
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKnjizenjeStavkaList
		{
			get { return _allowNewItemInIDKnjizenjeStavkaList;}
			set
			{
				this._allowNewItemInIDKnjizenjeStavkaList = value;
				this.uxIDKnjizenjeStavkaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.ObracunKamata> _IDObracunKamataList;
		
		/// <summary> 
		/// The list of selectable ObracunKamata
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObracunKamata> IDObracunKamataList
		{
			get {return this._IDObracunKamataList;}
			set 
			{
				this._IDObracunKamataList = value;
				this.uxIDObracunKamataDataGridViewColumn.DataSource = null;
				this.uxIDObracunKamataDataGridViewColumn.DataSource = this._IDObracunKamataList;
			}
		}
		
		private bool _allowNewItemInIDObracunKamataList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObracunKamata
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObracunKamataList
		{
			get { return _allowNewItemInIDObracunKamataList;}
			set
			{
				this._allowNewItemInIDObracunKamataList = value;
				this.uxIDObracunKamataDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Organizacija> _IDOrganizacijaList;
		
		/// <summary> 
		/// The list of selectable Organizacija
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Organizacija> IDOrganizacijaList
		{
			get {return this._IDOrganizacijaList;}
			set 
			{
				this._IDOrganizacijaList = value;
				this.uxIDOrganizacijaDataGridViewColumn.DataSource = null;
				this.uxIDOrganizacijaDataGridViewColumn.DataSource = this._IDOrganizacijaList;
			}
		}
		
		private bool _allowNewItemInIDOrganizacijaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Organizacija
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOrganizacijaList
		{
			get { return _allowNewItemInIDOrganizacijaList;}
			set
			{
				this._allowNewItemInIDOrganizacijaList = value;
				this.uxIDOrganizacijaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ObracunKamataProknjizen> _ObracunKamataProknjizenList;
				
		/// <summary> 
		/// The list of ObracunKamataProknjizen to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ObracunKamataProknjizen> ObracunKamataProknjizenList
		{
			get {return this._ObracunKamataProknjizenList;}
			set
			{
				this._ObracunKamataProknjizenList = value;
				this.uxObracunKamataProknjizenBindingSource.DataSource = null;
				this.uxObracunKamataProknjizenBindingSource.DataSource = value;
				this.uxObracunKamataProknjizenDataGridView.DataSource = null;
				this.uxObracunKamataProknjizenDataGridView.DataSource = this.uxObracunKamataProknjizenBindingSource;				
				//this.uxObracunKamataProknjizenBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxObracunKamataProknjizenBindingSource_ListChanged);
				this.uxObracunKamataProknjizenBindingSource.CurrentItemChanged += new System.EventHandler(OnObracunKamataProknjizenBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnObracunKamataProknjizenBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentObracunKamataProknjizen = uxObracunKamataProknjizenBindingSource.Current as Entities.ObracunKamataProknjizen;
			
			if (_currentObracunKamataProknjizen != null)
			{
				_currentObracunKamataProknjizen.Validate();
			}
			//_ObracunKamataProknjizen.Validate();
			OnCurrentEntityChanged();
		}

		//void uxObracunKamataProknjizenBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ObracunKamataProknjizen"/> instance.
		/// </summary>
		public Entities.ObracunKamataProknjizen SelectedObracunKamataProknjizen
		{
			get {return this._currentObracunKamataProknjizen;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxObracunKamataProknjizenDataGridView.VirtualMode;}
			set
			{
				this.uxObracunKamataProknjizenDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxObracunKamataProknjizenDataGridView.AllowUserToAddRows;}
			set {this.uxObracunKamataProknjizenDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxObracunKamataProknjizenDataGridView.AllowUserToDeleteRows;}
			set {this.uxObracunKamataProknjizenDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxObracunKamataProknjizenDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxObracunKamataProknjizenDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ObracunKamataProknjizenDataGridViewBase"/> class.
		/// </summary>
		public ObracunKamataProknjizenDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxObracunKamataProknjizenDataGridView = new System.Windows.Forms.DataGridView();
			this.uxObracunKamataProknjizenBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxObracunKamataProknjizenErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDKnjizenjeStavkaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDOrganizacijaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDObracunKamataDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxKontoSifraPrijenosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDugIliPotDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxKontrolaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDKnjizenjeStavkaBindingSource = new KnjizenjeStavkaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKnjizenjeStavkaBindingSource)).BeginInit();
			//this.uxIDObracunKamataBindingSource = new ObracunKamataBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunKamataBindingSource)).BeginInit();
			//this.uxIDOrganizacijaBindingSource = new OrganizacijaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOrganizacijaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxObracunKamataProknjizenErrorProvider
			// 
			this.uxObracunKamataProknjizenErrorProvider.ContainerControl = this;
			this.uxObracunKamataProknjizenErrorProvider.DataSource = this.uxObracunKamataProknjizenBindingSource;						
			// 
			// uxObracunKamataProknjizenDataGridView
			// 
			this.uxObracunKamataProknjizenDataGridView.AutoGenerateColumns = false;
			this.uxObracunKamataProknjizenDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxObracunKamataProknjizenDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDKnjizenjeStavkaDataGridViewColumn,
		this.uxIDOrganizacijaDataGridViewColumn,
		this.uxIDObracunKamataDataGridViewColumn,
		this.uxKontoSifraPrijenosDataGridViewColumn,
		this.uxDugIliPotDataGridViewColumn,
		this.uxKontrolaDataGridViewColumn			});
			this.uxObracunKamataProknjizenDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxObracunKamataProknjizenDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxObracunKamataProknjizenDataGridView.Name = "uxObracunKamataProknjizenDataGridView";
			this.uxObracunKamataProknjizenDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxObracunKamataProknjizenDataGridView.TabIndex = 0;	
			this.uxObracunKamataProknjizenDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxObracunKamataProknjizenDataGridView.EnableHeadersVisualStyles = false;
			this.uxObracunKamataProknjizenDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnObracunKamataProknjizenDataGridViewDataError);
			this.uxObracunKamataProknjizenDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunKamataProknjizenDataGridViewCellValueNeeded);
			this.uxObracunKamataProknjizenDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunKamataProknjizenDataGridViewCellValuePushed);
			
			//
			// uxIDKnjizenjeStavkaDataGridViewColumn
			//
			this.uxIDKnjizenjeStavkaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKnjizenjeStavkaDataGridViewColumn.DataPropertyName = "IDKnjizenjeStavka";
			this.uxIDKnjizenjeStavkaDataGridViewColumn.HeaderText = "IDKnjizenjeStavka";
			this.uxIDKnjizenjeStavkaDataGridViewColumn.Name = "uxIDKnjizenjeStavkaDataGridViewColumn";
			this.uxIDKnjizenjeStavkaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKnjizenjeStavkaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKnjizenjeStavkaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOrganizacijaDataGridViewColumn
			//
			this.uxIDOrganizacijaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOrganizacijaDataGridViewColumn.DataPropertyName = "IDOrganizacija";
			this.uxIDOrganizacijaDataGridViewColumn.HeaderText = "IDOrganizacija";
			this.uxIDOrganizacijaDataGridViewColumn.Name = "uxIDOrganizacijaDataGridViewColumn";
			this.uxIDOrganizacijaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOrganizacijaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOrganizacijaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObracunKamataDataGridViewColumn
			//
			this.uxIDObracunKamataDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObracunKamataDataGridViewColumn.DataPropertyName = "IDObracunKamata";
			this.uxIDObracunKamataDataGridViewColumn.HeaderText = "IDObracunKamata";
			this.uxIDObracunKamataDataGridViewColumn.Name = "uxIDObracunKamataDataGridViewColumn";
			this.uxIDObracunKamataDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObracunKamataDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObracunKamataDataGridViewColumn.ReadOnly = false;		
			//
			// uxKontoSifraPrijenosDataGridViewColumn
			//
			this.uxKontoSifraPrijenosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKontoSifraPrijenosDataGridViewColumn.DataPropertyName = "KontoSifraPrijenos";
			this.uxKontoSifraPrijenosDataGridViewColumn.HeaderText = "KontoSifraPrijenos";
			this.uxKontoSifraPrijenosDataGridViewColumn.Name = "uxKontoSifraPrijenosDataGridViewColumn";
			this.uxKontoSifraPrijenosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKontoSifraPrijenosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKontoSifraPrijenosDataGridViewColumn.ReadOnly = false;		
			//
			// uxDugIliPotDataGridViewColumn
			//
			this.uxDugIliPotDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDugIliPotDataGridViewColumn.DataPropertyName = "DugIliPot";
			this.uxDugIliPotDataGridViewColumn.HeaderText = "DugIliPot";
			this.uxDugIliPotDataGridViewColumn.Name = "uxDugIliPotDataGridViewColumn";
			this.uxDugIliPotDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDugIliPotDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDugIliPotDataGridViewColumn.ReadOnly = false;		
			//
			// uxKontrolaDataGridViewColumn
			//
			this.uxKontrolaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKontrolaDataGridViewColumn.DataPropertyName = "Kontrola";
			this.uxKontrolaDataGridViewColumn.HeaderText = "Kontrola";
			this.uxKontrolaDataGridViewColumn.Name = "uxKontrolaDataGridViewColumn";
			this.uxKontrolaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKontrolaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKontrolaDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDKnjizenjeStavkaDataGridViewColumn
			//				
			this.uxIDKnjizenjeStavkaDataGridViewColumn.DisplayMember = "IDKonto";	
			this.uxIDKnjizenjeStavkaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDKnjizenjeStavkaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDKnjizenjeStavkaDataGridViewColumn.DataSource = uxIDKnjizenjeStavkaBindingSource;				
				
			//
			// uxIDObracunKamataDataGridViewColumn
			//				
			this.uxIDObracunKamataDataGridViewColumn.DisplayMember = "IDKlijent";	
			this.uxIDObracunKamataDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObracunKamataDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObracunKamataDataGridViewColumn.DataSource = uxIDObracunKamataBindingSource;				
				
			//
			// uxIDOrganizacijaDataGridViewColumn
			//				
			this.uxIDOrganizacijaDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDOrganizacijaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOrganizacijaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOrganizacijaDataGridViewColumn.DataSource = uxIDOrganizacijaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxObracunKamataProknjizenDataGridView);
			this.Name = "ObracunKamataProknjizenDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKnjizenjeStavkaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunKamataBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOrganizacijaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunKamataProknjizenBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ObracunKamataProknjizenDataGridViewEventArgs args = new ObracunKamataProknjizenDataGridViewEventArgs();
				args.ObracunKamataProknjizen = _currentObracunKamataProknjizen;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ObracunKamataProknjizenDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ObracunKamataProknjizen	_ObracunKamataProknjizen;
	
			/// <summary>
			/// the  Entities.ObracunKamataProknjizen instance.
			/// </summary>
			public Entities.ObracunKamataProknjizen ObracunKamataProknjizen
			{
				get { return _ObracunKamataProknjizen; }
				set { _ObracunKamataProknjizen = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxObracunKamataProknjizenDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataProknjizenDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxObracunKamataProknjizenDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataProknjizenDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunKamataProknjizenDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDKnjizenjeStavkaDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].IDKnjizenjeStavka;
						break;
					case "uxIDOrganizacijaDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].IDOrganizacija;
						break;
					case "uxIDObracunKamataDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].IDObracunKamata;
						break;
					case "uxKontoSifraPrijenosDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].KontoSifraPrijenos;
						break;
					case "uxDugIliPotDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].DugIliPot;
						break;
					case "uxKontrolaDataGridViewColumn":
						e.Value = ObracunKamataProknjizenList[e.RowIndex].Kontrola;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxObracunKamataProknjizenDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunKamataProknjizenDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunKamataProknjizenDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDKnjizenjeStavkaDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].IDKnjizenjeStavka = (System.Int32)e.Value;
						break;
					case "uxIDOrganizacijaDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].IDOrganizacija = (System.Int32)e.Value;
						break;
					case "uxIDObracunKamataDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].IDObracunKamata = (System.Int32)e.Value;
						break;
					case "uxKontoSifraPrijenosDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].KontoSifraPrijenos = (System.String)e.Value;
						break;
					case "uxDugIliPotDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].DugIliPot = (System.Boolean)e.Value;
						break;
					case "uxKontrolaDataGridViewColumn":
						ObracunKamataProknjizenList[e.RowIndex].Kontrola = (System.String)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
